import React from "react";
import PropTypes from "prop-types"


import './index.scss'
import uuid from "../../utils/uuid";
import {NavLink} from "react-router-dom";

export default function Path(props) {



    return (
        <div className={ 'path-warp' }>
            <div className={ 'path' }>
                <NavLink to={ `/netdisk/space?path=${encodeURIComponent(props.path)}` } className={ 'back' } >返回上一级</NavLink>
                { props.path.split('/')
                    .filter(v => v)
                    .map((v, k) => {
                        return (
                            <span className={ 'name' } key={ uuid() }  > { v } </span>
                        )
                    }) }
            </div>
            <span className={ 'count' }>已全部加载，共{ 2 }个</span>
        </div>
    )
}

Path.propTypes = {
    style: PropTypes.object,
    className: PropTypes.string,
    path: PropTypes.string
}

Path.defaultProps = {
    style: {},
    className: '',
    path: '/momoky/java'
}